﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="VisitSummaryDataSet" targetNamespace="http://tempuri.org/VisitSummaryDataSet.xsd" xmlns:mstns="http://tempuri.org/VisitSummaryDataSet.xsd" xmlns="http://tempuri.org/VisitSummaryDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="RISConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="RISConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.ViewLayer.Properties.Settings.GlobalReference.Default.RISConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="Visit_TableAdapter" GeneratorDataComponentClassName="Visit_TableAdapter" Name="Visit_" UserDataComponentName="Visit_TableAdapter">
            <MainSource>
              <DbSource ConnectionRef="RISConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        V.VisitNumberId_ AS AccessionNumber, VS.Value_ AS VisitStatus, V.AdmitTime_, AT.Value_ AS AdmissionType, PT.Name_ AS PTName, L.Value_ AS Laterality, V.DischargeTime_, PTE.Value_ AS PatientType, PCE.Value_ AS PatientClass, ASE.Value_ AS AmbulatoryStatus, EP.FamilyName_ +' '+EP.GivenName_ AS OrderingPractitioner, O.ReasonForStudy_, OPE.Value_ AS OrderPriority, OSE.Value_ AS OrderStatus, PSE.Value_ AS ProcedureStatus, IAE.Value_ AS ImageAvailability

FROM            Visit_ AS V INNER JOIN
                         Order_ AS O ON V.OID_ = O.VisitOID_ INNER JOIN
                         Procedure_ AS P ON O.OID_ = P.OrderOID_ INNER JOIN
                         ProcedureType_ AS PT ON P.ProcedureTypeOID_ = PT.OID_ CROSS JOIN
                         LateralityEnum_ AS L,
                         AdmissionTypeEnum_ AS AT,
                         VisitStatusEnum_ AS VS,
PatientTypeEnum_ AS PTE,
PatientClassEnum_ AS PCE,
VisitAmbulatoryStatus_ AS VAS,
AmbulatoryStatusEnum_ AS ASE,
ExternalPractitioner_ AS EP,
OrderPriorityEnum_ AS OPE,
OrderStatusEnum_ AS OSE,
ProcedureStatusEnum_ AS PSE,
ImageAvailabilityEnum_ AS IAE

WHERE        (V.VisitNumberId_ = @visitOID) AND (L.Code_ = P.Laterality_) 
AND V.AdmissionType_ = AT.Code_ 
AND V.Status_ = VS.Code_ 
AND V.PatientClass_ = PCE.Code_ 
AND V.PatientType_= PTE.Code_ 
AND VAS.AmbulatoryStatus_ = ASE.Code_ 
AND VAS.VisitOID_ = V.OID_ 
AND EP.OID_ = O.OrderingPractitionerOID_ 
AND OPE.Code_ = O.Priority_
AND OSE.Code_ = O.Status_
AND PSE.Code_ = P.Status_
AND IAE.Code_ = P.ImageAvailability_

</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="visitOID" ColumnName="VisitNumberId_" DataSourceName="RIS.dbo.Visit_" DataTypeServer="nvarchar(50)" DbType="String" Direction="Input" ParameterName="@visitOID" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumn="AccessionNumber" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="AdmitTime_" DataSetColumn="AdmitTime_" />
              <Mapping SourceColumn="DischargeTime_" DataSetColumn="DischargeTime_" />
              <Mapping SourceColumn="AccessionNumber" DataSetColumn="AccessionNumber" />
              <Mapping SourceColumn="VisitStatus" DataSetColumn="VisitStatus" />
              <Mapping SourceColumn="AdmissionType" DataSetColumn="AdmissionType" />
              <Mapping SourceColumn="PTName" DataSetColumn="PTName" />
              <Mapping SourceColumn="Laterality" DataSetColumn="Laterality" />
              <Mapping SourceColumn="PatientType" DataSetColumn="PatientType" />
              <Mapping SourceColumn="PatientClass" DataSetColumn="PatientClass" />
              <Mapping SourceColumn="AmbulatoryStatus" DataSetColumn="AmbulatoryStatus" />
              <Mapping SourceColumn="OrderingPractitioner" DataSetColumn="OrderingPractitioner" />
              <Mapping SourceColumn="ReasonForStudy_" DataSetColumn="ReasonForStudy_" />
              <Mapping SourceColumn="OrderPriority" DataSetColumn="OrderPriority" />
              <Mapping SourceColumn="OrderStatus" DataSetColumn="OrderStatus" />
              <Mapping SourceColumn="ProcedureStatus" DataSetColumn="ProcedureStatus" />
              <Mapping SourceColumn="ImageAvailability" DataSetColumn="ImageAvailability" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="VisitSummaryDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="True" msprop:Generator_DataSetName="VisitSummaryDataSet" msprop:Generator_UserDSName="VisitSummaryDataSet">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Visit_" msprop:Generator_TableClassName="Visit_DataTable" msprop:Generator_TableVarName="tableVisit_" msprop:Generator_TablePropName="Visit_" msprop:Generator_RowDeletingName="Visit_RowDeleting" msprop:Generator_UserTableName="Visit_" msprop:Generator_RowChangingName="Visit_RowChanging" msprop:Generator_RowEvHandlerName="Visit_RowChangeEventHandler" msprop:Generator_RowDeletedName="Visit_RowDeleted" msprop:Generator_RowEvArgName="Visit_RowChangeEvent" msprop:Generator_RowChangedName="Visit_RowChanged" msprop:Generator_RowClassName="Visit_Row">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="AdmitTime_" msprop:Generator_ColumnVarNameInTable="columnAdmitTime_" msprop:Generator_ColumnPropNameInRow="AdmitTime_" msprop:Generator_ColumnPropNameInTable="AdmitTime_Column" msprop:Generator_UserColumnName="AdmitTime_" type="xs:dateTime" minOccurs="0" />
              <xs:element name="DischargeTime_" msprop:Generator_ColumnVarNameInTable="columnDischargeTime_" msprop:Generator_ColumnPropNameInRow="DischargeTime_" msprop:Generator_ColumnPropNameInTable="DischargeTime_Column" msprop:Generator_UserColumnName="DischargeTime_" type="xs:dateTime" minOccurs="0" />
              <xs:element name="AccessionNumber" msprop:Generator_ColumnVarNameInTable="columnAccessionNumber" msprop:Generator_ColumnPropNameInRow="AccessionNumber" msprop:Generator_ColumnPropNameInTable="AccessionNumberColumn" msprop:Generator_UserColumnName="AccessionNumber">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="VisitStatus" msprop:Generator_ColumnVarNameInTable="columnVisitStatus" msprop:Generator_ColumnPropNameInRow="VisitStatus" msprop:Generator_ColumnPropNameInTable="VisitStatusColumn" msprop:Generator_UserColumnName="VisitStatus" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="AdmissionType" msprop:Generator_ColumnVarNameInTable="columnAdmissionType" msprop:Generator_ColumnPropNameInRow="AdmissionType" msprop:Generator_ColumnPropNameInTable="AdmissionTypeColumn" msprop:Generator_UserColumnName="AdmissionType" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PTName" msprop:Generator_ColumnVarNameInTable="columnPTName" msprop:Generator_ColumnPropNameInRow="PTName" msprop:Generator_ColumnPropNameInTable="PTNameColumn" msprop:Generator_UserColumnName="PTName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Laterality" msprop:Generator_ColumnVarNameInTable="columnLaterality" msprop:Generator_ColumnPropNameInRow="Laterality" msprop:Generator_ColumnPropNameInTable="LateralityColumn" msprop:Generator_UserColumnName="Laterality" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PatientType" msprop:Generator_ColumnVarNameInTable="columnPatientType" msprop:Generator_ColumnPropNameInRow="PatientType" msprop:Generator_ColumnPropNameInTable="PatientTypeColumn" msprop:Generator_UserColumnName="PatientType" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PatientClass" msprop:Generator_ColumnVarNameInTable="columnPatientClass" msprop:Generator_ColumnPropNameInRow="PatientClass" msprop:Generator_ColumnPropNameInTable="PatientClassColumn" msprop:Generator_UserColumnName="PatientClass" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="AmbulatoryStatus" msprop:Generator_ColumnVarNameInTable="columnAmbulatoryStatus" msprop:Generator_ColumnPropNameInRow="AmbulatoryStatus" msprop:Generator_ColumnPropNameInTable="AmbulatoryStatusColumn" msprop:Generator_UserColumnName="AmbulatoryStatus" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OrderingPractitioner" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnOrderingPractitioner" msprop:Generator_ColumnPropNameInRow="OrderingPractitioner" msprop:Generator_ColumnPropNameInTable="OrderingPractitionerColumn" msprop:Generator_UserColumnName="OrderingPractitioner" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="81" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="ReasonForStudy_" msprop:Generator_ColumnVarNameInTable="columnReasonForStudy_" msprop:Generator_ColumnPropNameInRow="ReasonForStudy_" msprop:Generator_ColumnPropNameInTable="ReasonForStudy_Column" msprop:Generator_UserColumnName="ReasonForStudy_" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="400" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OrderPriority" msprop:Generator_ColumnVarNameInTable="columnOrderPriority" msprop:Generator_ColumnPropNameInRow="OrderPriority" msprop:Generator_ColumnPropNameInTable="OrderPriorityColumn" msprop:Generator_UserColumnName="OrderPriority" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OrderStatus" msprop:Generator_ColumnVarNameInTable="columnOrderStatus" msprop:Generator_ColumnPropNameInRow="OrderStatus" msprop:Generator_ColumnPropNameInTable="OrderStatusColumn" msprop:Generator_UserColumnName="OrderStatus" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="ProcedureStatus" msprop:Generator_ColumnVarNameInTable="columnProcedureStatus" msprop:Generator_ColumnPropNameInRow="ProcedureStatus" msprop:Generator_ColumnPropNameInTable="ProcedureStatusColumn" msprop:Generator_UserColumnName="ProcedureStatus" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="ImageAvailability" msprop:Generator_ColumnVarNameInTable="columnImageAvailability" msprop:Generator_ColumnPropNameInRow="ImageAvailability" msprop:Generator_ColumnPropNameInTable="ImageAvailabilityColumn" msprop:Generator_UserColumnName="ImageAvailability" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>